# write写文件 read读文件
# f = open('test.txt', 'w')
# f.write("hello ")
# f.close()
#
# f = open('test.txt', 'a')
# f.write('world!')
# f.close()
#
# f = open('test.txt', 'r')
# # 1. 直接read
# # print(f.read(2))
#
# # 2.循环
# # for line in f:
# #     print(line)
#
# # 3.readline
# # lines = f.readline()
# # print(lines)
# # f.close()

# 中文utf8
f = open('6.txt', 'r', encoding='utf8')
# print(f.read(2))
for line in f:
    # end='' 设置打印后的添加物
    print(line, end='')

f.close()



